<?php

include('../function/user.function.php');
require('../../config/connexion_db.config.php');

$select = "SELECT id,nom,prenom,email FROM users ";
$where='';
if(count($_POST)>0){
	$where.='where';
	if(isset($_POST['genreh'])) $where.=' genre = "'.$_POST['genreh'].'" or';
	if(isset($_POST['genref'])) $where.=' genre = "'.$_POST['genref'].'" or';
}

$where = substr($where,0,-2);
$requete = $select.''.$where;
$resultat=$connexion->query($requete);
$tabResultat=$resultat->fetchAll(PDO::FETCH_ASSOC);
$tab=formateSelectAll($tabResultat);

echo $tab;
?>




